<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.11.
   家居公司点评列表($$)*/

!defined('Q_PATH') && exit;

class Comment_C_Controller extends InitController{

	public function index(){
		$arrJiajucompany=$this->_oParent->_arrJiajucompany;
		
		Core_Extend::getSeo($this,array(
			'title'=>"{$arrJiajucompany['jiajucompany_fullname']}网友点评-{$arrJiajucompany['jiajucompany_fullname']}网友真实客观评价",
			'keywords'=>"{$arrJiajucompany['jiajucompany_fullname']}网友点评,{$arrJiajucompany['jiajucompany_fullname']}网友真实客观评价",
			'description'=>"{$arrJiajucompany['jiajucompany_fullname']}网友点评，{$arrJiajucompany['jiajucompany_fullname']}网友真实客观评价。",
		));

		// 点评列表
		$arrWhere=array();
		$arrWhere['jiajucompanycomment_status']=1;
		$arrWhere['jiajucompany_id']=$arrJiajucompany['jiajucompany_id'];

		$nTotal=Model::F_('jiajucompanycomment')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,10,Jiaju_Extend::getCommentpageUrl($arrJiajucompany,false));
		$arrComments=Model::F_('jiajucompanycomment')
			->setColumns('user_id,create_dateline,jiajucompanycomment_name,jiajucompanycomment_level,jiajucompanycomment_level1,jiajucompanycomment_level2,jiajucompanycomment_level3,jiajucompanycomment_level4,jiajucompanycomment_level5,jiajucompanycomment_content,jiajucompanycomment_replytime,jiajucompanycomment_replycontent,jiajucompanycomment_replytime')
			->where($arrWhere)
			->order('jiajucompanycomment_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		$this->assign('arrComments',$arrComments);
		$this->assign('nTotalComment',$nTotal);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display(Jiaju_Extend::getTemplate($arrJiajucompany));
	}

}
